<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 1.for循环
        for (var i = 0; i < 10; i++) {
            console.log('nihao');
        }

        var sum = 0;
        for (var i = 0; i <= 100; i++) {
            sum += i;
        }
        console.log(sum);

        //双重for循环
        var str = '';
        for (var i = 0; i < 5; i++) {
            for (var j = i; j < 5; j++) {
                str += '⭐';
            }
            str += '\n';
        }
        console.log(str);

        //while循环
        var num = 1;
        while (num <= 100) {
            console.log('你好');
            num++;
        }

        //do while 循环
        do {
            var message = prompt('你爱我吗');
        }
        while(message !== '爱')
    </script>

</head>

<body>

</body>

</html>